package 二叉树链式存储;

import java.sql.SQLOutput;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.BTNode root = binaryTree.creatBinaryTree();
        binaryTree.preOrder(root); // 前序遍历
        System.out.println();
        binaryTree.inOrder(root);  // 中序遍历
        System.out.println();
        binaryTree.postOrder(root);// 后序遍历
        System.out.println("======================");
        System.out.println("树中节点个数:" + binaryTree.size(root)); // 树中节点个数
        System.out.println("树中叶子节点个数:" + binaryTree.getLeafNodeCount(root)); // 树中叶子节点个数
        int K = 2;
        System.out.println("第" + K + "层节点数:" + binaryTree.getKLevelNodeCount(root,K));
        System.out.println("树的高度为"+binaryTree.getHeight(root));
        System.out.println(binaryTree.find(root,6).val);

        binaryTree.levelOrder1(root);




    }
}
